﻿

using System.Collections.Generic;
using Inovout.Land;
using ESRI.ArcGIS.Geometry;
using Inovout.Gis.Geometry;
namespace Inovout.Gis.Land.DiLei.GuiHua
{
    /// <summary>
    /// 基期年地类
    /// </summary>
    public class JQNDiLeiLayer
    {

        public static readonly JQNDiLeiLayer Instance = new JQNDiLeiLayer();
        private DiLeiPointLayer pointLayer;
        public DiLeiPointLayer PointLayer
        {
            get { return pointLayer; }
            set { pointLayer = value; }
        }
        private DiLeiLineLayer lineLayer;
        public DiLeiLineLayer LineLayer
        {
            get { return lineLayer; }
            set { lineLayer = value; }
        }
        private DiLeiPolygonLayer polygonLayer;
        public DiLeiPolygonLayer PolygonLayer
        {
            get { return polygonLayer; }
            set { polygonLayer = value; }
        }
        private JQNDiLeiLayer()
        {
        }

        public List<FLMJX> GetDLMJXs()
        {
            pointLayer.GetDLMJXs();
            lineLayer.GetDLMJXs();
            polygonLayer.GetDLMJXs();

            double pointIntersectLineArea = 0;
            double mj;
            List<DiLeiPoint> points = new List<DiLeiPoint>(pointLayer.Points);
            foreach (var point in points)
            {
                lineLayer.Intersect(point, out mj);
                pointIntersectLineArea += mj;
                if (mj > 0)
                {
                    points.Remove(point);
                }
            }
            double pointIntersectPolygonArea = 0;
            foreach (var point in points)
            {
                polygonLayer.Intersect(point, out mj);
                pointIntersectPolygonArea += mj;
                if (mj > 0)
                {
                    points.Remove(point);
                }
            }

            return null;
        }
    }
}
